﻿@section header
{
    <link rel="stylesheet" href="~/Themes/RongJi/Style/base/css/sign.css?v=1">
}
@section title
{
    修改密码
}
@section pagetitle
{
    修改密码
}
<div class="userCenterHeader">
    <span class="iconWrapper">
        <img src="~/Themes/RongJi/Style/base/imgs/icon_mi.png">
    </span>
    <h3>修改密码</h3>
    <br class="clearfix">
</div>
    <form action="~/MyAccount/ChangePassword" id="pwdForm">
        <div class="body">

            <input type="password" id="oldPwd" maxlength="20" name="oldPwd" value=""  class="form-control" placeholder="请输入旧密码">
            <input type="password" id="newPwd" maxlength="20" name="newPwd" value="" class="form-control" placeholder="请输入新密码">
            <input type="password" id="txtRePassword" maxlength="20" value="" class="form-control" placeholder="请输入确认密码">
            @if (Model.Result != null && !Model.Result.Status)
            {
                <span class="err_msg">@Model.Result.ErrorMessage</span>
            }
            else
            {
                <span class="err_msg" id="msgError"></span>
            }
        </div>
        <div class="bottom">
            <div class="btn-group btn-group-justified btn-wrapper" role="group" aria-label="...">
                <div class="btn-group" role="group">
                    <input type="submit" id="btnSubmit" class="btn btn-green" value="保存">
                </div>
                <div class="btn-group" role="group">
                    <a type="button" href="~/MyAccount/Home" class="btn">取消</a>
                </div>
            </div>
        </div>
    </form>





@section footer
{

    <script type="text/javascript">

        $(function () {
            //让底部toolbar选中
            var $homeImg = $("#homeImg");
            var $categoryImg = $("#categoryImg");
            var $myaccountImg = $("#myaccountImg");
            var $searchImg = $("#searchImg");
            $homeImg.attr("src", "/Themes/RongJi/Style/base/imgs/f10.png");
            $categoryImg.attr("src", "/Themes/RongJi/Style/base/imgs/f2.png");
            $myaccountImg.attr("src", "/Themes/RongJi/Style/base/imgs/f3_c.png");
            $searchImg.attr("src", "/Themes/RongJi/Style/base/imgs/f4.png");

            $("#btnSubmit").click(function () {
                if ($('#oldPwd').val() == "") {
                    KevinShop.MessageBox.Alert("请输入旧密码!");
                    return false;
                }
                if ($('#newPwd').val() == "") {
                    KevinShop.MessageBox.Alert("请输入新密码!");
                    return false;
                }
                if ($('#txtRePassword').val() == "") {
                    KevinShop.MessageBox.Alert("请输入确认密码!");
                    return false;
                }
                if ($('#newPwd').val() != $('#txtRePassword').val()) {
                    KevinShop.MessageBox.Alert("请确认新密码和确认密码是一样的!");
                    return false;
                }
                document.forms["pwdForm"].submit();
                return false;
            });
        });
    </script>
}
